Page({
  data: {
    lists: [
      {name: '修改密码', action: 'modifyPsw', arrow: true},
      {name: '退出登录', action: 'logout', arrow: false},
    ]
  },
  onLoad(options) {},
  onReady() {},
  onShow() {
    if (typeof this.getTabBar === 'function' &&  this.getTabBar()) {
      this.getTabBar().setData({
        selected: 4
      })
    }
  },
  listItemTap(e){
    let currentItem = e.currentTarget.dataset.item;
    if (currentItem.action == 'modifyPsw') {
      wx.navigateTo({
        url: '/packageA/pages/resetPsw/index',
      })
    } else {
      wx.removeStorageSync('token')
      wx.removeStorageSync('userInfo')
      wx.removeStorageSync('userService')
      wx.switchTab({
        url: '/pages/index/index',
      })
    }
  },
  onUnload() {},
})